<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <script src="../lib/jquery-3.4.1.js"></script>
    <script src="../lib/layui/layui.js"></script>
    <script src="../lib/constant.js"></script>
    <link rel="stylesheet" href="../lib/layui/css/layui.css">
    <style>
        *{
            font-family: "微软雅黑 Light";
        }
    </style>
</head>
<body>
<h1>用户管理</h1>

<table id="demo" lay-filter="test"></table>

</body>
<script>
    layui.use('table', function(){

        // var json = eval("("+data+")"); // data的值是json字符串，这行把字符串转成object
        // alert(json.name);// 取出属性值testname


        table = layui.table;
        //第一个实例
        tableIns=table.render({
            elem: '#demo'
            ,width:950
            ,height: 700
            ,url: '/admin/userlist' //数据接口
            ,page: true //开启分页
            ,limit: 10
            ,cols: [[ //表头
                {field: 'id', title: '用户编号', fixed: 'left',width:150}
                ,{field: "username", title: '用户名',width:150}
                ,{field: "phone", title: '手机号',width:150}
                ,{field: "email", title: '邮箱',width:150}
                ,{field: "status", title: '状态',width:150}
                ,{field: "school", title: '所属学校',width:500}
            ]]
        });
    });
</script>
</html>